package com.itheima.stringJoinerDemo;

import java.util.StringJoiner;

public class stringJoinerDemo2 {
    public static void main(String[] args) {
        //1.创建对象
        StringJoiner sj = new StringJoiner("---","[","]");

        //2.添加元素
        sj.add("a").add("b").add("c");
        System.out.println(sj.toString());

        int len = sj.length();
        System.out.println(len);//sj的长度表示字符的个数，包括开始结束和间隔
    }
}
